import request from '@/utils/request'
import qs from 'qs';

const baseUrl = "http://localhost:8080/api";

// 添加游戏
export function reqAddGame(data) {
    return request({
        url: `${baseUrl}/addGame`,
        method: 'post',
        data: qs.stringify(data)
    })
}

// 获取游戏列表
export function reqGameList() {
    return request({
        url: `${baseUrl}/getGame`,
        method: 'post'
    })
}

// 下架游戏
export function reqDeleteGame(data) {
    return request({
        url: `${baseUrl}/deleteGame`,
        method: 'post',
        data: qs.stringify(data)
    })
}

// 添加折扣
export function reqAddDisCount(data) {
    return request({
        url: `${baseUrl}/addDisCount`,
        method: 'post',
        data: qs.stringify(data)
    })
}

// 下架折扣
export function reqDeleteDiscount(data) {
    return request({
        url: `${baseUrl}/deleteDiscount`,
        method: 'post',
        data: qs.stringify(data)
    })
}